{% comment %} <!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户注册 - ShortVid</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    {% load static %}
    <link rel="stylesheet" href="{% static 'accounts/register.css' %}">
</head>
<body>
    <div class="floating-shapes">
        <div class="shape"></div>
        <div class="shape"></div>
        <div class="shape"></div>
    </div>
    
    <div class="register-container">
        <div class="brand-logo">
            <h1><i class="fas fa-play-circle me-2"></i>ShortVid</h1>
            <p>发现精彩短视频</p>
        </div>
        
        <h2>用户注册</h2>
        
        {% if messages %}
        <div class="messages">
            {% for message in messages %}
            <div class="alert alert-{{ message.tags }}">
                {{ message }}
            </div>
            {% endfor %}
        </div>
        {% endif %}
        
        <form method="post">
            {% csrf_token %}
            
            <div class="form-group">
                <label for="id_username">用户名</label>
                <div class="form-icon">
                    {{ form.username }}
                    <i class="fas fa-user"></i>
                </div>
                {% if form.username.help_text %}
                <div class="help-text">{{ form.username.help_text }}</div>
                {% endif %}
                {% if form.username.errors %}
                <ul class="errorlist">
                    {% for error in form.username.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            
            {% if form.email %}
            <div class="form-group">
                <label for="id_email">邮箱</label>
                <div class="form-icon">
                    {{ form.email }}
                    <i class="fas fa-envelope"></i>
                </div>
                {% if form.email.help_text %}
                <div class="help-text">{{ form.email.help_text }}</div>
                {% endif %}
                {% if form.email.errors %}
                <ul class="errorlist">
                    {% for error in form.email.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            {% endif %}
            
            <div class="form-group">
                <label for="nickname">昵称</label>
                <div class="form-icon">
                    <input type="text" id="nickname" name="nickname" placeholder="请输入昵称" required>
                    <i class="fas fa-user-circle"></i>
                </div>
            </div>
            
            <div class="form-group">
                <label for="gender">性别</label>
                <div class="form-icon">
                    <select id="gender" name="gender" required>
                        <option value="">请选择性别</option>
                        <option value="male">男</option>
                        <option value="female">女</option>
                    </select>
                    <i class="fas fa-venus-mars"></i>
                </div>
            </div>
            
            <div class="form-group">
                <label for="phone">手机号</label>
                <div class="form-icon">
                    <input type="tel" id="phone" name="phone" placeholder="请输入手机号" required>
                    <i class="fas fa-phone"></i>
                </div>
            </div>
            
            <div class="form-group">
                <label for="email_address">邮箱地址</label>
                <div class="form-icon">
                    <input type="email" id="email_address" name="email_address" placeholder="请输入邮箱地址" required>
                    <i class="fas fa-at"></i>
                </div>
            </div>
            
            <div class="form-group">
                <label for="id_password1">密码</label>
                <div class="form-icon">
                    {{ form.password1 }}
                    <i class="fas fa-lock"></i>
                </div>
                {% if form.password1.help_text %}
                <div class="help-text">{{ form.password1.help_text }}</div>
                {% endif %}
                {% if form.password1.errors %}
                <ul class="errorlist">
                    {% for error in form.password1.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            
            <div class="form-group">
                <label for="id_password2">确认密码</label>
                <div class="form-icon">
                    {{ form.password2 }}
                    <i class="fas fa-lock"></i>
                </div>
                {% if form.password2.help_text %}
                <div class="help-text">{{ form.password2.help_text }}</div>
                {% endif %}
                {% if form.password2.errors %}
                <ul class="errorlist">
                    {% for error in form.password2.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            
            <button type="submit" class="btn-register">注册</button>
        </form>
        
        <div class="login-link">
            <p>已有账号？<a href="{% url 'login' %}">立即登录</a></p>
        </div>
    </div>

    <!-- Bootstrap JS 和依赖 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{% static 'accounts/register.js' %}"></script>
</body>
</html> {% endcomment %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户注册 - ShortVid</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    {% load static %}
    <link rel="stylesheet" href="{% static 'accounts/register.css' %}">
</head>
<body>
    <div class="floating-shapes">
        <div class="shape"></div>
        <div class="shape"></div>
        <div class="shape"></div>
    </div>
    
    <div class="register-container">
        <div class="brand-logo">
            <h1><i class="fas fa-play-circle me-2"></i>ShortVid</h1>
            <p>发现精彩短视频</p>
        </div>
        
        <h2>用户注册</h2>
        
        {% if messages %}
        <div class="messages">
            {% for message in messages %}
            <div class="alert alert-{{ message.tags }}">
                {{ message }}
            </div>
            {% endfor %}
        </div>
        {% endif %}
        
        <form method="post">
            {% csrf_token %}
            
            <div class="form-group">
                <label for="id_username">用户名</label>
                <div class="form-icon">
                    {{ form.username }}
                    <i class="fas fa-user"></i>
                </div>
                {% if form.username.help_text %}
                <div class="help-text">{{ form.username.help_text }}</div>
                {% endif %}
                {% if form.username.errors %}
                <ul class="errorlist">
                    {% for error in form.username.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            
            {% if form.email %}
            <div class="form-group">
                <label for="id_email">邮箱</label>
                <div class="form-icon">
                    {{ form.email }}
                    <i class="fas fa-envelope"></i>
                </div>
                {% if form.email.help_text %}
                <div class="help-text">{{ form.email.help_text }}</div>
                {% endif %}
                {% if form.email.errors %}
                <ul class="errorlist">
                    {% for error in form.email.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            {% endif %}

            <div class="form-group">
                <label for="id_nickname">昵称</label>
                <div class="form-icon">
                    <input type="text" id="id_nickname" name="nickname" placeholder="请输入昵称">
                    <i class="fas fa-signature"></i>
                </div>
            </div>

            <div class="form-group">
                <label for="id_phone">手机号</label>
                <div class="form-icon">
                    <input type="text" id="id_phone" name="phone" placeholder="请输入手机号">
                    <i class="fas fa-phone"></i>
                </div>
            </div>

            <div class="form-group">
                <label for="id_gender">性别</label>
                <div class="form-icon select-wrapper">
                    <select id="id_gender" name="gender">
                        <option value="male">男 (male)</option>
                        <option value="female">女 (female)</option>
                    </select>
                    <i class="fas fa-venus-mars"></i>
                </div>
            </div>

            <div class="form-group">
                <label for="id_password1">密码</label>
                <div class="form-icon">
                    {{ form.password1 }}
                    <i class="fas fa-lock"></i>
                </div>
                {% if form.password1.help_text %}
                <div class="help-text">{{ form.password1.help_text }}</div>
                {% endif %}
                {% if form.password1.errors %}
                <ul class="errorlist">
                    {% for error in form.password1.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            
            <div class="form-group">
                <label for="id_password2">确认密码</label>
                <div class="form-icon">
                    {{ form.password2 }}
                    <i class="fas fa-lock"></i>
                </div>
                {% if form.password2.help_text %}
                <div class="help-text">{{ form.password2.help_text }}</div>
                {% endif %}
                {% if form.password2.errors %}
                <ul class="errorlist">
                    {% for error in form.password2.errors %}
                    <li>{{ error }}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            </div>
            
            <button type="submit" class="btn-register">注册</button>
        </form>
        
        <div class="login-link">
            <p>已有账号？<a href="{% url 'login' %}">立即登录</a></p>
        </div>
    </div>

    <!-- Bootstrap JS 和依赖 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{% static 'accounts/register.js' %}"></script>
</body>
</html>